import { fetchCates } from '@/services/umsApi';

export default {
    namespace: 'fetchList',
    state: {
        name: []
    },
    effects: {
        *fetchCates({ payload }, { call, put, select }) {
            try {
                const data = yield call(fetchCates, payload);
                yield put({
                    type: 'save',
                    payload: {
                        name: data,
                    },
                })
            } catch (error) { }
        },
    },
    reducers: {
        save(state, action) {
            return {
                ...state.name,
                ...action.payload,
            };
        },
    },
};